const url = require('url');
const logger = require('../utils/log');

const urlString = 'https://www.baidu.com:443/path/index.html?id=2&name=Tim#tag=3';
const urlObj = {
    protocol: 'https:',
    slashes: true,
    auth: null,
    host: 'www.baidu.com:443',
    port: '443',
    hostname: 'www.baidu.com',
    hash: '#tag=3',
    search: '?id=2&name=Tim',
    query: 'id=2&name=Tim',
    pathname: '/path/index.html',
    path: '/path/index.html?id=2&name=Tim',
    href: 'https://www.baidu.com:443/path/index.html?id=2&name=Tim#tag=3'
}
const url2 = new URL('https://www.baidu.com:443/path/index.html?id=2&name=Tim#tag=3');
const params = new URLSearchParams('?id=2&name=Tim');
logger.debug(params.get('id'))
// logger.debug(url2);
// logger.debug(url2.searchParams.get('id'))
// logger.debug(url.parse(urlString));
// logger.debug(url.format(urlObj))
// console.log(url.pathToFileURL(urlString), url.parse(urlString));